package com.fh.modules.dbms.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * @Author qiujunda
 * @Date 14/07/2020
 * @Description
 */
@Data
@TableName("dbms_table_index")
public class DbmsTableIndex implements Serializable {
    private static final long serialVersionUID = 1010230L;

    /**主键*/
    @TableId(type = IdType.AUTO)
    private Long id;

    private Long tableId;

    private String indexName;

    private String indexType;

    private String uniqueness;

    private Integer columnNum;


    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    private Integer delFlag;

    private String collectSid;

    @Override
    public String toString() {
        return "索引{" +
                "索引名='" + indexName + '\'' +
                ", 类型='" + indexType + '\'' +
                ", 唯一='" + uniqueness + '\'' +
                ", 字段数量=" + columnNum +
                '}';
    }
}
